class PrintChar{
  constructor(char,num){
    this.for1=function(){
      var str=char;
      for(var i=1;i<=num;i++){
        var result="";
        for(var j=0;j<i;j++){
          result+=str;
        }
        console.log(result);
      }
    };
    this.for2=function(){
      var str=char;
      for(var i=num;i>=0;i--){
        var result="";
        for(var j=0;j<i;j++){
          result+=str;
        }
        console.log(result);
      }

    }
  }
}
var p1=new PrintChar("C",10);
p1.for1();
console.log("-------------");
p1.for2();
